package org.halk.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.halk.entity.User;
import org.halk.mapper.TestMapper;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@Component
public class GeneralService {

    @Resource
    private TestMapper testMapper;

    protected List<User> getAllUser(String projectId) {
        if (projectId.equalsIgnoreCase("HOR")) {
            return this.testMapper.selectList(new QueryWrapper<>());
        } else if (projectId.equalsIgnoreCase("VER")) {
            return new ArrayList<>();
        } else if (projectId.equalsIgnoreCase("TEST")) {
            return new ArrayList<>(Arrays.asList(new User().setName("test")));
        }else {
            return new ArrayList<>();
        }
    }
}
